#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
int xp,yp,xs,ys,x,y,f[110][110],_x[]={0,1,1,-1,-1,2,2,-2,-2},_y[]={0,2,-2,2,-2,1,-1,1,-1},ans;
queue<pair<int,int> >q;
void bfs()
{
	q.push(make_pair(x,y));
	f[x][y]=0;
	while(!q.empty())
	{
		x=q.front().fir;
		y=q.front().sec;
		q.pop();
		for(int i=1;i<=8;++i)
		{
			int xx=x+_x[i],yy=y+_y[i];
			if(xx<1||xx>100||yy<1||yy>100||~f[xx][yy])continue;
			f[xx][yy]=f[x][y]+1;
			q.push(make_pair(xx,yy));
			if(xx==50&&yy==50)return;
		}
	}
	return;
}
int main()
{
	memset(f,-1,sizeof(f));
	scanf("%d%d%d%d",&xp,&yp,&xs,&ys);
	x=abs(xp-xs);
	y=abs(yp-ys);
	while(x+y>=50)
	{
		if(x<y)swap(x,y);
		if(x-4>=2*y)x-=4;
		else
		{
			x-=4;
			y-=2;
		}
		ans+=2;
	}
	x+=50;
	y+=50;
	bfs();
	printf("%d\n",ans+f[50][50]);
	return 0;
}
